package dome2;

public class Test {
    public static void main(String[] args) {
        A a = new B() ;
    }
}
class A{
    private int num = 1 ;
    public void func1(){
        System.out.println("A的func" );
    }
    A(){
        func1();
    }
}
class B extends A{
    private int num = 2 ;
    public void func1(){
        System.out.println("B的func" + num);
    }
}
